package lab02.test11;

import static java.lang.Math.sqrt;

/**
 * Created by lenovo on 2017/10/20.
 */
public class Square extends Rectangle {
    public Square() {
    }

    public Square(double length, double wide) {
        super(length, wide);
    }

    public double diagonal() {
        return sqrt(length * length + wide * wide);
    }

    @Override
    public void printMyWay() {
        super.printMyWay();
        System.out.println("对角线：" + diagonal());
    }


}
